<!DOCTYPE html >
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8"/>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="shortcut icon" href="/images/favicon.ico"/>
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no">
    <meta name="format-detection" content="telephone=no" >
    <meta name="apple-touch-fullscreen" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <title></title>
    <link th:href="@{/css/taoke.css}"  rel="stylesheet"/>
    <link th:href="@{/css/swiper.min.css}"  rel="stylesheet"/>
    <script type="text/javascript" th:src="@{/js/clipboard.min.js}"></script>
</head>
<body>
<div class="xiangqing">

    <section class="pc-banner">
        <div class="swiper-container">


            <div class="swiper-wrapper" >
                <div class="swiper-slide swiper-slide-center none-effect">
                    <a href="#"><img  th:src="${image}" src="http://img4.tbcdn.cn/tfscom/i2/2841761332/TB2jp4Tcgb.PuJjSZFpXXbuFpXa_!!2841761332.jpg_640x640q50.jpg" ></a>
                </div>

                       <div class="swiper-slide" th:each="i:${m.nTbkItem.smallImages}"><a href="#">
                         <img  th:src="${i}" src="http://img4.tbcdn.cn/tfscom/i2/2841761332/TB2jp4Tcgb.PuJjSZFpXXbuFpXa_!!2841761332.jpg_640x640q50.jpg" ></a>
                       </div>


            </div>
        </div>
        <div class="swiper-pagination"></div>
    </section>

    <div class="xqh3"><img src="/images/cat.jpg"><h3 th:text="${m.model.pname}">一壶百饮全自动分体式中药锅煎药壶砂锅家用煎中医电熬药罐煲药煮</h3></div>
    <div class="jia_after2"><span>券后</span><em th:text="${m.model.price}">138.00</em>元</div>
    <span class="xiang_xiang">已售<ems th:text="${m.model.sales}">1844</ems></span><span class="xiang_you" th:text="${m.model.couponcode}">20</span>
    <br/>
    <div class="tuwen">
            <input id="pid" style="display: none;" th:value="${m.model.pid}">
        <a  id="opentw" class="chakan" data-id="">查看图文详情</a>
        <div class="tuwen2"></div>
    </div>
</div>

<div class="fengexian"><div class="line"></div><span>猜你喜欢</span><div class="line"></div></div>
<div class="splist_div">
    <ul>
        <li class="splist">
            <a href="/view/539465162124">
                <div class="listimg"><img src="https://img.alicdn.com/imgextra/i1/2991184651/TB2WLxEXxwb61BjSZJiXXbD3XXa_!!2991184651.jpg_200x200"></div>
                <div class="listh4"><img src="/images/cat.jpg" class="h4biao"><h4>Soar/索爱 CL-A98电热水壶家用自动断电快壶保温电壶电热烧水壶</h4><span class="jia_before">39.9元</span><div class="jia_after"><span>券后</span><em>34.90元</em></div><span class="fbiao1">已售<em>217109</em></span><span class="sy">券余100000张</span></div></a>
            <div class="quan"><span class="quan_span1">优惠券</span><p>5</p><a href="/view/539465162124" class="quan_span2">领券购买</a></div>
        </li>

    </ul>
</div>
<div class="cheng"></div>
<div class="tiao_btn2"><div style="width:70%;"><span class="tiaoqh">券后价：<em th:text="${m.model.price}">138元</em></span><span class="dashed" th:text="${m.model.oldprice}"">158元</span>
</div><!--<a style="display: none;" id="tw_a" >图文分享</a>--><a style="width: 30%;" id="ling_a" class="copy_a">领券购买</a></div>
<div id="layer">
    <div class="layer"></div>
    <div class="layerdiv"><div>
        <div class="layerdiv-tle"><span>淘口令购买</span><button id="copy_close"><img src="/images/closegray.png" alt=""></button></div>
        <div class="xqcopy"><p>复制这条信息，打开<em class="xqcopy-em1"> [手机淘宝] </em>即可看到<span>【一壶百饮全自动分体式中药锅煎药壶砂锅家用煎中医电熬药罐煲药煮】<em class="xqcopy-em2">￥GS7k0NmzJg5￥</em></span></p></div>
        <button id="copy_1">一键复制</button>
        <table class="xqcopy-table">
            <tr>
                <td><img src="/images/bu1.png" alt=""><span>1.一键复制</span></td>
                <td><img src="/images/bu2.png" alt=""><span>2.打开手机淘宝</span></td>
                <td><img src="/images/bu3.png" alt=""><span>3.领取优惠券</span></td>
            </tr>
        </table>
        <p style="font-size:0.75rem"><em class="xqcopy-em2">注：</em>若一键复制失败，请手动长按复制淘口令。</p>
    </div>
    </div>
</div>
<div id="layer">
    <div class="layer"></div>
    <div class="layerdiv">
        <div>
            <div class="layerdiv-tle">
                <span>淘口令购买</span>
                <button id="copy_close">
                    <img src="/images/closewhite.png" alt=""></button>
            </div>
            <div class="xqcopy" id="copy_key_ios">
                <p>长按复制这条信息，打开[手机淘宝]即可看到【一壶百饮全自动分体式中药锅煎药壶砂锅家用煎中医电熬药罐煲药煮】￥GS7k0NmzJg5￥</p>
            </div>
            <textarea id="copy_key_android" type="text" class="xqcopy_textarea" oninput="regain();">复制这条信息，打开[手机淘宝]即可看到【一壶百饮全自动分体式中药锅煎药壶砂锅家用煎中医电熬药罐煲药煮】￥GS7k0NmzJg5￥</textarea>
            <button id="copy_1">一键复制</button>
            <p>使用说明：复制淘口令后打开【手机淘宝】即可领取优惠券购买！</p>
        </div>
    </div>
</div>
<div id="gotop"><img src="/images/top.svg"></div>
<div id="mas"><img src="/images/mas.png"></div>
<div id="layerma"><div class="layerblack" id="layerblack"></div><div class="layerma1"><span class="ma-title">长按二维码收藏</span>
    <img src="/images/qrcode.jpg" class="ma1"><span class="matext">官方公众号</span></div></div>
<!--两个二维码： <div id="layerma"><div class="layerblack" id="layerblack"></div><div class="layerma2"><span class="ma-title2">长按二维码关注</span><div><img src="images/ma.png" class="ma2"><span class="matext2">微信公众号</span></div><div><img src="images/ma.png" class="ma2"><span class="matext2">微信客服</span></div></div></div> -->
<!--图文分享-->
<div id="layertuwen2">
    <div class="layertw-black2"></div>
    <div class="tw-content2">
        <div class="tw-content-part3"><div class="close-tw"></div></div>
        <div class="tw-content-part4"><p>请长按图片进行保存</p></div>
    </div>

</div>

<script type="text/javascript" th:src="@{/js/taoke.js}"></script>
<script type="text/javascript" th:src="@{/js/jquery.js}"></script>
<script type="text/javascript" th:src="@{/js/function.js}"></script>
<script type="text/javascript" th:src="@{/js/swiper.min.js}"></script>
<script type="text/javascript" th:src="@{/js/layer.js}"></script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script>
    window.onload = function() {
        var swiper = new Swiper('.swiper-container',{

            loop:true,
            centeredSlides : true,
            slidesPerView:2,
            pagination : '.swiper-pagination',
            paginationClickable:true,
            prevButton:'.swiper-button-prev',
            nextButton:'.swiper-button-next',
            onInit:function(swiper){
                swiper.slides[2].className="swiper-slide swiper-slide-active";//第一次打开不要动画
            },
            breakpoints: {
                668: {
                    slidesPerView: 1
                }
            }
        });
    };
    addLoadEvent(gotop);
    addLoadEvent(openMa);
    addLoadEvent(openlink);

    wx.config({
        debug: false,
        appId: 'wxd7cfad8c3c20c2ba',
        timestamp: 1517909544,
        nonceStr: 'ON92H2rRGJBPyRYc',
        signature: '51f30d166afd05fcedb29af25245cdc99ade8704',
        jsApiList: [
            'onMenuShareTimeline',
            'onMenuShareAppMessage'
        ]
    });
    wx.ready(function () {
        var shareData = {
            title: '一壶百饮全自动分体式中药锅煎药壶砂锅家用煎中医电熬药罐煲药煮',
            desc: '送你20元优惠券，快来领取吧~',
            link: location.href.split('#')[0],
            imgUrl: 'http://img.alicdn.com/bao/uploaded/i3/2841761332/TB1RgDlXAKWBuNjy1zjXXcOypXa_!!0-item_pic.jpg_200x200'
        };
        wx.onMenuShareAppMessage(shareData);
        wx.onMenuShareTimeline(shareData);
    });

    $(function () {
        //图文分享开关
        $("#tw_a").click(function(){
            var _this = $(this);
            var id = '558551395105';
            var img = 'http://img.alicdn.com/bao/uploaded/i3/2841761332/TB1RgDlXAKWBuNjy1zjXXcOypXa_!!0-item_pic.jpg_500x500.jpg';
            var title = '一壶百饮全自动分体式中药锅煎药壶砂锅家用煎中医电熬药罐煲药煮';
            var price = '158.00';
            var couponPrice = '20.00';
            var type = '1';
            _this.text('生成中…');
            $.get('/index/shareimg',{id:id,img:img,title:title,price:price,couponPrice:couponPrice,type:type},function(data){
                if(data.res){
                    $("#layertuwen2").find('.share_img').remove();
                    $("#layertuwen2").find('.tw-content-part3').append('<img src="'+data.goodsShareImg+'" alt="" class="share_img"/>');
                    $("#layertuwen2").show();
                    _this.text('图文分享');
                }else{
                    layer.msg(data.msg);
                    _this.text('图文分享');
                }
            },'json');
        });

        $(".close-tw").click(function(){
            $("#layertuwen2").hide();
        });

        //图文详情
        $("#opentw").click(function(){
            var _this = $(this);
            if($(this).hasClass("chakan")){
                $(this).removeClass("chakan");
                var itemid = $("#pid").val();
                $(".tuwen2").show();
                _this.html("数据加载中…");
                _this.attr('disabled',true);
                $.get("https://hws.m.ta"+"ob"+"ao.com/cache/mtop.wdetail.getItemDescx/4.1/?data=%7Bitem_num_id%3A" + itemid + "%7D&type=jsonp&dataType=jsonp",function(data){
                    if (data.ret[0] == "SUCCESS::接口调用成功") {
                        var len = data.data.images.length;
                        var image = new Array();
                        for (var i = 0; i < len; i++) {
                            image[i] = '<img width="100%" src="' + data.data.images[i] + '">';
                        }
                        $('.tuwen2').html(image);
                    } else {
                        $(".tuwen2").html("宝贝数据调用失败，原因：" + data.ret[0]);

//					$('#qf_alert').modal();
                    }
                    _this.html("收起图文详情");
                    _this.removeAttr('disabled');
                },'jsonp');
            }else{
                _this.html("查看图文详情");
                $(this).addClass("chakan");
                $(".tuwen2").children().remove();
                $(".tuwen2").hide();
            }
            return false;
        })

        var clipboard = new Clipboard('#copy_1', {
            text: function() {
                return '复制这条信息，打开[手机淘宝]即可看到【一壶百饮全自动分体式中药锅煎药壶砂锅家用煎中医电熬药罐煲药煮】￥GS7k0NmzJg5￥';
            }
        });

        clipboard.on('success', function(e) {
            $('#copy_1').html('复制成功').attr('id','copy_2');
        });

        clipboard.on('error', function(e) {
            $('#copy_1').html('请手动复制').attr('id','copy_2');
        });

        //事件监听
        //------------------------------------------
        document.addEventListener("selectionchange", function (e) {
            if (window.getSelection().anchorNode.parentNode.id == 'copy_key_ios' && document.getElementById('copy_key_ios').innerText != window.getSelection()) {
                var key = document.getElementById('copy_key_ios');
                window.getSelection().selectAllChildren(key);
            }
            if (window.getSelection().anchorNode.parentNode.id == 'copy_key_ios1' && document.getElementById('copy_key_ios1').innerText != window.getSelection()) {
                var key = document.getElementById('copy_key_ios1');
                window.getSelection().selectAllChildren(key);
            }
            if (window.getSelection().anchorNode.parentNode.id == 'copy_key_ios2' && document.getElementById('copy_key_ios2').innerText != window.getSelection()) {
                var key = document.getElementById('copy_key_ios2');
                window.getSelection().selectAllChildren(key);
            }
            if (window.getSelection().anchorNode.parentNode.id == 'copy_key_ios3' && document.getElementById('copy_key_ios3').innerText != window.getSelection()) {
                var key = document.getElementById('copy_key_ios3');
                window.getSelection().selectAllChildren(key);
            }
            if (window.getSelection().anchorNode.parentNode.id == 'copy_key_ios4' && document.getElementById('copy_key_ios4').innerText != window.getSelection()) {
                var key = document.getElementById('copy_key_ios4');
                window.getSelection().selectAllChildren(key);
            }
        }, false);

    });

    var ua = navigator.userAgent.toLowerCase();
    if (ua.match(/iphone/i) == "iphone" || ua.match(/ipad/i) == "ipad") {
        $("#copy_key_android").hide();
        $("#copy_key_android1").hide();
        $("#copy_key_android2").hide();
        $("#copy_key_android3").hide();
        $("#copy_key_android4").hide();
        $("#copy_key_ios").show();
        $("#copy_key_ios1").show();
        $("#copy_key_ios2").show();
        $("#copy_key_ios3").show();
        $("#copy_key_ios4").show();
        $('.fq-explain span').html("长按框内 > 拷贝");

    } else {
        $("#copy_key_ios").hide();
        $("#copy_key_ios1").hide();
        $("#copy_key_ios2").hide();
        $("#copy_key_ios3").hide();
        $("#copy_key_ios4").hide();
        $("#copy_key_android").show();
        $("#copy_key_android1").show();
        $("#copy_key_android2").show();
        $("#copy_key_android3").show();
        $("#copy_key_android4").show();
    }

    if(document.getElementById("copy_key_android")){
        var taokouling_value = document.getElementById("copy_key_android").value;
        function regain() {
            document.getElementById('copy_key_android').value = taokouling_value;
        }
    }

    if(document.getElementById("copy_key_android1")){
        var taokouling_value1 = document.getElementById("copy_key_android1").value;
        function regain1() {
            document.getElementById('copy_key_android1').value = taokouling_value1;
        }
    }
    if(document.getElementById("copy_key_android2")){
        var taokouling_value2 = document.getElementById("copy_key_android2").value;
        function regain2() {
            document.getElementById('copy_key_android2').value = taokouling_value2;
        }
    }
    if(document.getElementById("copy_key_android3")){
        var taokouling_value3 = document.getElementById("copy_key_android3").value;
        function regain3() {
            document.getElementById('copy_key_android3').value = taokouling_value3;
        }
    }
    if(document.getElementById("copy_key_android4")){
        var taokouling_value4 = document.getElementById("copy_key_android4").value;
        function regain4() {
            document.getElementById('copy_key_android4').value = taokouling_value4;
        }
    }

    function copyToClipboard(txt) {
        if (window.clipboardData) {alert('1')
            window.clipboardData.clearData();
            clipboardData.setData("Text", txt);
            alert("复制成功！");

        } else if (navigator.userAgent.indexOf("Opera") != -1) {alert('2')
            window.location = txt;
        } else if (window.netscape) {alert('3')
            try {
                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
            } catch (e) {
                alert("被浏览器拒绝！\n请在浏览器地址栏输入'about:config'并回车\n然后将 'signed.applets.codebase_principal_support'设置为'true'");
            }
            var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
            if (!clip)
                return;
            var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
            if (!trans)
                return;
            trans.addDataFlavor("text/unicode");
            var str = new Object();
            var len = new Object();
            var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
            var copytext = txt;
            str.data = copytext;
            trans.setTransferData("text/unicode", str, copytext.length * 2);
            var clipid = Components.interfaces.nsIClipboard;
            if (!clip)
                return false;
            clip.setData(trans, null, clipid.kGlobalClipboard);
            alert("复制成功！");
        }else{
            alert('4')
        }
    }
</script>
</body>
</html>